<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .red {
            color: red;
        }
    </style>
</head>
<body>
    <div id="app">
        <ul>
            <li v-for='(item, index) in letters' @click='change_color(index)' :class="{red: index === flag}"> {{item}} </li>
        </ul>
    </div>
    <script src="./vue.js"></script>
    <script>
        var app = new Vue({
            el: '#app',
            data: {
                letters: ['aaaa', 'bbbb', 'ccccc', 'ddddd'],
                flag : -1，
                wyb : true
            },
            methods: {
                change_color(index){
                    return this.flag = index
                }
            }
        })
    </script>
</body>
</html>